/**
 * 功能:
 * 作者:周逸健
 * 日期: 2023/11/8 15:48
 */
package com.cgnfz.crm.controller;

import com.cgnfz.crm.entity.RestBean;
import com.cgnfz.crm.entity.vo.response.ApproveResp;
import com.cgnfz.crm.service.ApproveHistoryService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
@RequestMapping("/api/approve")
@Slf4j
public class ApproveHistoryController {

    @Resource
    ApproveHistoryService approveHistoryService;

    @GetMapping("/selectPage")
    public RestBean<ApproveResp> selectPage(@RequestParam String employeeId,
                                            @RequestParam String customer,
                                            @RequestParam String approveType,
                                            @RequestParam Long pageNum,
                                            @RequestParam Long pageSize) {
        return RestBean.success(approveHistoryService.selectPage(employeeId, customer, approveType, pageNum, pageSize));
    }

    @GetMapping("/approveList")
    public RestBean<ApproveResp> approveList(@RequestParam String employeeId,
                                            @RequestParam String customer,
                                            @RequestParam String approveType) {
        return RestBean.success(approveHistoryService.approveList(employeeId, customer, approveType));
    }
}
